import { lazy } from "react";

export let mainRouter = [
    {
        path : '/home/index',
        element : lazy(() => import ('../page/Index/Index'))
    },
    {
        path : '/home/appmanagement',
        element : lazy(() => import ('../page/Index/Application/App_management'))
    },
    {
        path : '/home/recycle',
        element : lazy(() => import ('../page/Index/Application/Recycle'))
    },
    {
        path : '/home/authentication',
        element : lazy(() => import ('../page/Index/AccountCenter/Authentication'))
    },
    {
        path : '/home/contact',
        element : lazy(() => import ('../page/Index/AccountCenter/Contact'))
    },
    {
        path : '/home/infomation',
        element : lazy(() => import ('../page/Index/AccountCenter/Infomation'))
    }, 
    {
        path : '/home/createOrder',
        element : lazy(() => import ('../page/Index/repairOrder/CreateOrder'))
    },
    {
        path : '/home/orderList',
        element : lazy(() => import ('../page/Index/repairOrder/OrderList'))
    },
    {
        path : '/home/dataVisualization',
        element : lazy(() => import ('../page/Index/DataVisualization'))
    },
    
]

const routes = [
    {
        path : '*',
        element : lazy(() => import ('../page/Error404'))
    },
    {
        path : '/login',
        element : lazy(() => import ('../page/Login'))
    },
    {
        path : '/home',
        element : lazy(() => import ('../page/Home')),
        children : mainRouter
    },
    {
        from :'/',
        to  : '/home/index'
    }
   
]

export default routes